package burubaka.service;

import org.slim3.datastore.Datastore;

import burubaka.dao.SystemInfoDao;
import burubaka.meta.SystemInfoMeta;
import burubaka.model.SystemInfo;

import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.KeyFactory;

public class SystemInfoService {

	SystemInfoDao dao = new SystemInfoDao();
	SystemInfoMeta meta = new SystemInfoMeta();

	public SystemInfo getSystemInfo() {
		return Datastore.query(meta).asSingle();
	}

	public Key getKey(Long id) {
		return KeyFactory.createKey(meta.getKind(), id);
	}

	public SystemInfo regist(SystemInfo model) {
		dao.putAsync(model);
		return model;
	}

}
